package com.mcptt.config.local;

import java.io.File;
import java.util.Locale;

import org.json.JSONException;
import org.json.JSONObject;

import com.cloudptt.api.comm.Common;
import com.cloudptt.api.comm.FileOperation;
import com.cloudptt.api.comm.IniFileParser;
import com.cloudptt.api.product.ILanChange;
import com.cloudptt.api.product.Product;
import com.cloudptt.api.product.ProductConst;
import com.cloudptt.api.product.func.sys.IRestartServer;
import com.cloudptt.api.product.log.Log;
import com.cloudptt.api.product.res.Resource;
import com.mcptt.config.VideoConfig;
import com.mcptt.config.model.McIdInfo;
import com.mcptt.config.model.McpttLoginInfo;
import com.mcptt.config.model.ServerInfo;
import com.mcptt.db.model.AddrInfo;
import com.mcptt.db.model.GroupInfo;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Environment;
import android.util.DisplayMetrics;

public class SysConfig
{
	private static final String Name = "SysConfig";
	
	private static final String Key_Name = "name";
	private static final String Key_Type = "type";
	private static final String Key_McId = "mcId";
	private static final String Key_Pwd = "password";

//	private static final String Key_McpttId = "mcpttId";
//	private static final String Key_McvideoId = "mcvideoId";
//	private static final String Key_McdataId = "mcdataId";
	
	private static final String Key_HttpIp = "httpIp";
	private static final String Key_HttpPort = "httpPort";

	private static final String Key_Ip = "serverIp";
	private static final String Key_Port = "serverPort";

	private static final String Key_FileIp = "fileIp";
	private static final String Key_FilePort = "filePort";

	private static final String Key_GisIp = "gisIp";
	private static final String Key_GisPort = "gisPort";

//	private static final String Key_Impi = "impi";
//	private static final String Key_Impu = "impu";
//	private static final String Key_Realm = "realm";
//	private static final String Key_Mcptt_Psi = "mcpttPsi";
//	private static final String Key_Mcvideo_Psi = "videoPsi";
//	private static final String Key_Mcdata_Psi = "dataPsi";

	private static final String Key_AccessToken = "accessToken";
	private static final String Key_ExpireData = "expireData";
	private static final String Key_ClientId = "clientId";
	private static final String Key_RedirectUri = "redirectUri";
	public static final String Key_Language = "language";
	public static final String Key_VideoResolving = "resolving";
	
	public static final String Key_DefaultGroupNum = "defaultGroupNum";
	public static final String Key_UserId = "userId";
	public static final String Key_TokenUserID = "tokenUserID";
	public static final String Key_GisInterval = "gisInterval";
	public static final String Key_TxLevel = "txLevel";
	public static final String Key_RxLevel = "rxLevel";
	public static final String Key_IsAlarm = "alarm";
	public static final String Key_IsShowApp = "showApp";

	
	private Context ctx = null;
	private SharedPreferences sp = null;

//	private String accessToken = null;
//	private long expireData = 0;
	private String clientId = null;
	private String devId = null;
	private String redirectUri = null;

	private McIdInfo mcInfo = null;
	
	private VideoConfig videoConfig = null;
	
	// 语言
	public static final String LAN_ZH_CN = "zh_CN";
	public static final String LAN_EN_US = "en_GB";
	
	

//	private ImsInfo imsInfo = null;
	private static ServerInfo serverInfo = null;
	private static ServerInfo httpServerInfo = null;
	private static ServerInfo fileServerInfo = null;
	private static ServerInfo gisServerInfo = null;


	private String gisSvrIpPort = null;

	private String curLan = LAN_ZH_CN;

//	private IRestartServer server = null;
	private ILanChange lanChange = null;
	
	private boolean isLogined = false;
//	private boolean isDownloadGroup = false;
	private String defaultGroupNum = null;

	private String userID = "";
	private String tokenUserID = "";
	private int gisInterval = 30;
	private String allCallGNum = "";
	private GroupInfo sosGroupInfo = null;
	private float txLevel = 0.3f;
	private float rxLevel = 1.0f;
	private boolean isAlarm = false;
	private boolean isShowApp = true;

	public SysConfig(Context ctx,ILanChange lanChange)
	{
		Log.debug(this.getClass(), "SysConfig");
		this.ctx = ctx;
//		this.server = server;
		this.lanChange = lanChange;
		this.isLogined = false;
//		this.isDownloadGroup = false;
		
		this.sp = ctx.getSharedPreferences("local", Activity.MODE_PRIVATE);
//		String impi = sp.getString(Key_Impi, "001010000702222@ims.mnc001.mcc001.3gppnetwork.org");
//		String impu = sp.getString(Key_Impu, "mcptt.70-2222.zta-1@ims.mnc001.mcc001.3gppnetwork.org");
//		String realm = sp.getString(Key_Realm, Realm_Default);
//		this.imsInfo = new ImsInfo(impi,impu,realm);
		int type = sp.getInt(Key_Type, McIdInfo.TYPE_INTEL);
		String mcId = sp.getString(Key_McId, "");
		String pwd = sp.getString(Key_Pwd, "");
		this.mcInfo= new McIdInfo(type,mcId,pwd);
		
		String name = sp.getString(Key_Name, "");
		this.mcInfo.updateName(name);

//		String defaultIp = ServerInfo.Default_Svr_Ip;

		String httpIp = sp.getString(Key_HttpIp, ServerInfo.Default_Svr_Ip);
		int httpPort = sp.getInt(Key_HttpPort, 10010);
		this.httpServerInfo= new ServerInfo(httpIp,httpPort);

		String ip = sp.getString(Key_Ip, ServerInfo.Default_Svr_Ip);
		int port = sp.getInt(Key_HttpPort, ServerInfo.Default_Svr_Port);
		this.serverInfo= new ServerInfo(ip,port);
		AddrInfo.setSvrAddrDesc(ip,port);

		String fileSvrIp = sp.getString(Key_FileIp, ServerInfo.Default_Svr_Ip);
		int filePort = sp.getInt(Key_FilePort, 10004);
		this.fileServerInfo = new ServerInfo(fileSvrIp,filePort);

		String gisIp = sp.getString(Key_GisIp, ServerInfo.Default_Svr_Ip);
		int gisPort = sp.getInt(Key_GisPort, 10016);
		this.gisServerInfo = new ServerInfo(gisIp,gisPort);


		
		Log.debug(SysConfig.class,"LocalConfig mcInfo = " + mcInfo  +  " serverInfo = " + serverInfo );
		Log.debug(SysConfig.class,"LocalConfig fileServerInfo = " + fileServerInfo  +  " gisServerInfo = " + gisServerInfo );

		
		
//		this.clientId = sp.getString(Key_ClientId, "hytera_app");
		this.userID = sp.getString(Key_ClientId, "Key_UserId");
		this.clientId = sp.getString(Key_ClientId, "HyteraApp");
		this.redirectUri = sp.getString(Key_RedirectUri, "http://3gpp.mcptt/cb");
		
		String defaultLan = getDefaultLan();
		this.curLan = sp.getString(Key_Language, defaultLan);
		Locale locale = getLocale(curLan);
		Resource.init(ctx, locale);
		updateAppLanguage(locale);
		
		
		int videoResolving = sp.getInt(Key_VideoResolving, VideoConfig.VideoResolving_VGA);
		videoConfig = new VideoConfig(videoResolving);
		
		defaultGroupNum = sp.getString(Key_DefaultGroupNum, GroupInfo.Group_Num_All);
		
		gisInterval = sp.getInt(Key_GisInterval, 30);
		txLevel = sp.getFloat(Key_TxLevel, 1.95f);
		rxLevel = sp.getFloat(Key_RxLevel, 0.35f);
		isAlarm = sp.getBoolean(Key_IsAlarm,false);
		isShowApp= sp.getBoolean(Key_IsShowApp,true);
//		if(initCallBack != null)
//		{
//			initCallBack.initialSuc(Name);
//		}
		//	this.ConfigFileVerMap = new HashMap<String, String>();
		//	String version = sp.getString(UserProfile.FileName, "");
		//	ConfigFileVerMap.put(UserProfile.FileName, version);
		//	
		//	version = sp.getString(Service.FileName, "");
		//	ConfigFileVerMap.put(Service.FileName, version);
	}

	public VideoConfig getVideoConfig() {
		return videoConfig;
	}
	public void setVideoResolving(int videoResolving) 
	{
		int val = videoConfig.getVideoResolving();
		if(val == videoResolving)
		{
			return;
		}
		this.videoConfig.setVideoResolving(videoResolving);
		
		SharedPreferences.Editor editor = sp.edit();
		editor.putInt(Key_VideoResolving, videoResolving);
		editor.commit();
	}
	
	private Locale getLocale(String lanStr)
	{
		if(LAN_ZH_CN.equals(lanStr))
		{
			return Locale.CHINA;
		}
		else if(LAN_EN_US.equals(lanStr))
		{
			return Locale.ENGLISH;
		}else if( isZh() ){
			return Locale.CHINA;
		}
		return Locale.ENGLISH;
	}
	private void updateAppLanguage( Locale locale) 
	{
		Resources resources  = ctx.getResources();
        Configuration config = resources.getConfiguration();
        config.locale = locale;
        
        DisplayMetrics dm = resources.getDisplayMetrics();
        resources.updateConfiguration(config, dm);
    }
	private String getDefaultLan()
	{
		if(isZh())
		{
			return LAN_ZH_CN;
		}
		return LAN_EN_US;
	}
	private boolean isZh() {
        Locale locale = Locale.getDefault( );
        String language = locale.getLanguage();
        Log.debug( SysConfig.class, "Locale.getDefault( ) = " + language );
        if (language.startsWith( "zh"))
            return true;
        else
            return false;
    }
	
	public void setCurLan(String curLan) {
		if(this.curLan.equals(curLan))
		{
			return;
		}
		this.curLan = curLan;
		SharedPreferences.Editor editor = sp.edit();
		editor.putString(Key_Language, curLan);

		editor.commit();
		lanChange.onLanChange(curLan);
	}

	public void setServerInfo(String ip,int port) 
	{
		Log.debug(SysConfig.class,"setServerInfo ip = " + ip  + " port = " + port );
		AddrInfo.setSvrAddrDesc(ip,port);
		this.serverInfo = new ServerInfo(ip,port);

		SharedPreferences.Editor editor = sp.edit();
		editor.putString(Key_Ip, ip);
		editor.putInt(Key_Port, port);

		editor.commit();
		setHttpServerInfo(ip,10010);

		
//		this.server.restartServer();
	}
	
	public void setHttpServerInfo(String ip,int port) 
	{
		Log.debug(SysConfig.class,"setHttpServerInfo ip = " + ip + " port = " + port );
//		AddrInfo.setSvrAddrDesc(ip,port);
		this.httpServerInfo = new ServerInfo(ip,port);

		SharedPreferences.Editor editor = sp.edit();
		editor.putString(Key_HttpIp, ip);
		editor.putInt(Key_HttpPort, port);

		editor.commit();
	}
	
	
	public ServerInfo getHttpServerInfo() {
		return httpServerInfo;
	}
	
	public void setFileServerInfo(String ip,int port)
	{
		Log.debug(SysConfig.class,"setFileServerInfo ip = " + ip + " port = " + port);
		this.fileServerInfo = new ServerInfo(ip,port);

		SharedPreferences.Editor editor = sp.edit();
		editor.putString(Key_FileIp, ip);
		editor.putInt(Key_FilePort, port);

		editor.commit();
	}

	public void setGisServerInfo(String ip,int port)
	{
		Log.debug(SysConfig.class,"setGisServerInfo ip = " + ip + " port = " + port);
		this.gisServerInfo = new ServerInfo(ip,port);

		SharedPreferences.Editor editor = sp.edit();
		editor.putString(Key_GisIp, ip);
		editor.putInt(Key_GisPort, port);

		editor.commit();
	}
	
	public static ServerInfo getServerInfo() {
		return serverInfo;
	}

	public static ServerInfo getFileServerInfo() {
		return fileServerInfo;
	}

	public static ServerInfo getGisServerInfo() {
		return gisServerInfo;
	}

	public void setMcInfo(int type,String mcId,String pwd)
	{
		Log.debug(SysConfig.class,"setMcInfo type = " + type + " mcId = " + mcId + " pwd = " + pwd );
		this.mcInfo.updateMcIdInfo(type,mcId, pwd);
//		this.mcInfo.updateName(mcId);

		SharedPreferences.Editor editor = sp.edit();
		editor.putInt(Key_Type, type);
		editor.putString(Key_McId, mcId);
		editor.putString(Key_Pwd, pwd);
		
//		editor.putString(Key_Name, mcId);

		editor.commit();
	}
	public void setMcpttLoginName(String name,String num)
	{
		Log.debug(SysConfig.class,"setMcpttInfo name = " + name + " num = " + num );
		if(mcInfo != null)
		{
			mcInfo.update(name,num);
		}

		SharedPreferences.Editor editor = sp.edit();
		editor.putString(Key_Name, name);

		editor.commit();
	}


	//    public boolean checkAndSaveConfigFileVer(String configFileName,String version)
	//    {
	//	if(ConfigFileVerMap == null
	//		|| ConfigFileVerMap.size() <= 0)
	//	{
	//	    return false;
	//	}
	//	String oldVesion = ConfigFileVerMap.get(configFileName);
	//	if(oldVesion != null
	//		&& oldVesion.length() <= 0
	//		&& oldVesion.equals(version))
	//	{
	//	    return true;
	//	}
	//	return false;
	//    }
	//    
	//    public void SaveConfigFileVer(String configFileName,String version)
	//    {
	//	if(ConfigFileVerMap == null
	//		|| ConfigFileVerMap.size() <= 0)
	//	{
	//	    return;
	//	}
	//
	//	ConfigFileVerMap.put(configFileName, version);
	//	
	//	SharedPreferences.Editor editor = sp.edit();
	//	editor.putString(configFileName, version);
	//	editor.commit();
	//    }


	public boolean checkMustParamOk()
	{
//		if(imsInfo == null
//				|| !imsInfo.checkMustParamOk())
//		{
//			return false;
//		}
		if(clientId == null
				|| clientId.length() <= 0)
		{
			return false;
		}
		if(redirectUri == null
				|| redirectUri.length() <= 0)
		{
			return false;
		}
		return true;
	}

//	public boolean checkAccessTokenExpire()
//	{
//		Log.debug(this.getClass(), "checkAccessTokenExpire");
//		if(this.accessToken == null
//				|| this.accessToken.length() <= 0)
//		{
//			return true;
//		}
//		long time = System.currentTimeMillis();
//		if(time <= expireData)
//		{
//			return false;
//		}
//
//		return true;
//	}

//	public void setTradeInfo(String clientId,String redirectUri) 
//	{
//		Log.debug(SysConfig.class,"setImsInfo clientId = " + clientId + " redirectUri = " + redirectUri);
//		this.clientId = clientId;
//		this.redirectUri = redirectUri;
//
//		if(imsInfo != null)
//		{
//			SharedPreferences.Editor editor = sp.edit();
//			editor.putString(Key_ClientId, clientId);
//			editor.putString(Key_RedirectUri, redirectUri);
//
//			editor.commit();
//		}
//	}
	
	public void setUserInfoBeforLogin(String mcId,String pwd)
	{
		Log.debug(SysConfig.class,"setUserInfoBeforLogin num = " + mcId + " pwd = " + pwd + " Product.getProductType() = " + Product.getProductType());
		this.isLogined = false;
//		this.isDownloadGroup = false;
		if(Product.getProductType() == ProductConst.ProductType_PAPP ) {
			if(mcInfo != null)
			{
				this.setMcInfo(McIdInfo.TYPE_INTEL,mcId, pwd);
			}
		}
		if(Product.getProductType() == ProductConst.ProductType_XAPP ) {
			if(mcInfo != null)
			{
				this.setMcInfo(McIdInfo.TYPE_FUNC,mcId, pwd);
			}
		}
		


		clearAllIfOtherUser();
	}

	public void setTestUserInfoBeforLogin(String mcId,String pwd)
	{
		Log.debug(SysConfig.class,"setUserInfoBeforLogin num = " + mcId + " pwd = " + pwd + " Product.getProductType() = " + Product.getProductType());
		this.isLogined = true;
//		this.isDownloadGroup = false;
		if(Product.getProductType() == ProductConst.ProductType_PAPP ) {
			if(mcInfo != null)
			{
				this.setMcInfo(McIdInfo.TYPE_INTEL,mcId, pwd);
			}
		}
		if(Product.getProductType() == ProductConst.ProductType_XAPP ) {
			if(mcInfo != null)
			{
				this.setMcInfo(McIdInfo.TYPE_FUNC,mcId, pwd);
			}
		}



		clearAllIfOtherUser();
	}

	public void setDevIdBeforLogin(String devId)
	{
		Log.debug(SysConfig.class,"setDevIdBeforLogin devId = " + devId);
		this.isLogined = true;
		this.devId = devId;
//		this.isDownloadGroup = false;
		if(devId.equals("00000000"))
		{
			this.devId = mcInfo.getMcId();
		}
		Log.debug(SysConfig.class,"setDevIdBeforLogin after devId = " + devId);

		if(mcInfo != null
			&& !devId.equals("00000000"))
		{
			this.setMcInfo(McIdInfo.TYPE_FUNC,devId, "123456");
			mcInfo.updateName(devId);
		}

		clearAllIfOtherUser();
	}

	private void clearAllIfOtherUser()
	{
//		String oldNum = sp.getString(SHARED_PROP_USERNAME_OLD, "");
//		Log.d(THIS_FILE,"setUserInfoAfterLoginSuc num = " + this.userInfo.getNum() + "oldUserName = " + oldNum);
//		if(oldNum == null
//				|| oldNum.length() <= 0
//				|| !this.userInfo.isSameNum(oldNum))
//		{
//			clearDefaultGroup();
//			dbOperator.resetTables();
//			Log.d(THIS_FILE,"setUserInfoAfterLoginSuc DbUtil.resetTables");
//		}
	}


//	public void setUserInfoAfterLoginSuc(String name,String userKey, long privilege) 
//	{
//		Log.d(THIS_FILE,"setUserInfoAfterLoginSuc name = " + name + " userKey = " + userKey
//				+ " privilege = " + Long.toHexString( privilege) );
//		
//		setMcInfo()
////		name = PlugTestConfigInfo.getInstance().findUserNameByNum(name);
////		this.userInfo.setName(name);
////		this.userInfo.setUserKey(userKey);
////		this.userInfo.setPrivilege( privilege );
////
////		SharedPreferences.Editor editor = sp.edit();
////		editor.putString(SHARED_PROP_NAME, name);
////		editor.putString(SHARED_PROP_USERKEY, userKey);
////		editor.putString(SHARED_PROP_USERNAME_OLD, userInfo.getNum());
////
////		editor.commit();
//	}
	
	public void setUserInfoAfterLoginSuc(String name,String num)
	{
		setMcpttLoginName(name,num);
		this.isLogined = true;
//		Log.d(THIS_FILE,"setUserInfoAfterLoginSuc num = " + num);
//		this.userInfo.setNum(num);
//		this.userInfo.setUserKey(userKey);
//
//		SharedPreferences.Editor editor = sp.edit();
//		editor.putString(SHARED_PROP_NUM, num);
//		editor.putString(SHARED_PROP_USERKEY, userKey);
//
//		editor.commit();
	}

	public void setPwdAfterChgPwd(String pwd) 
	{
//		Log.d(THIS_FILE,"setPwdAfterChgPwd pwd = " + pwd);
//		this.userInfo.setPwd(pwd);
//
//		SharedPreferences.Editor editor = sp.edit();
//		editor.putString(SHARED_PROP_PASSWORD, pwd);
//
//		editor.commit();
	}

	public void clearUserInfoAfterLogout() 
	{
		Log.debug(SysConfig.class,"clearUserInfoAfterLogout before Product.getProductType() = " + Product.getProductType() + " mcInfo = " + mcInfo);
		this.setMcpttLoginName("","");
		if(Product.getProductType() == ProductConst.ProductType_PAPP ) {
			this.setMcInfo(McIdInfo.TYPE_INTEL, "", "");
		}
		if(Product.getProductType() == ProductConst.ProductType_XAPP ) {
			this.setMcInfo(McIdInfo.TYPE_FUNC, "", "");
		}
		this.setDefaultGroupNum(GroupInfo.Group_Num_All);
//		this.isDownloadGroup = false;
		this.isLogined = false;
		Log.debug(SysConfig.class,"clearUserInfoAfterLogout Product.getProductType() = " + Product.getProductType() + " mcInfo = " + mcInfo);
	}
	
	public void clearUserInfoAfterExit() 
	{
//		this.isDownloadGroup = false;
		this.isLogined = false;
	}

	public McIdInfo getMcInfo()
	{
		return mcInfo;
	}
	public McpttLoginInfo getMcpttLoginInfo()
	{
		return new McpttLoginInfo(serverInfo,this.mcInfo,userID,getSipAuthJson());
	}

	public String getClientId()
	{
		return clientId;
	}

	public String getDevId() {
		return devId;
	}

	public void setDevId(String devId) {
		this.devId = devId;
		if(devId.equals("00000000"))
		{
			this.devId = mcInfo.getMcId();
		}
	}

	public String getRedirectUri()
	{
		return redirectUri;
	}

	public String getCurLan() {
		return curLan;
	}
	
	public boolean isLogined() {
		return isLogined;
	}
	public void setLoginedTrue() {
		this.isLogined = true;
	}
//	public boolean isDownloadGroup() {
//		return isDownloadGroup;
//	}
//	public void setDownloadGroupTrue() {
//		this.isDownloadGroup = true;
//	}
	
	public String getDefaultGroupNum() {
		return defaultGroupNum;
	}
	public void setDefaultGroupNum(String defaultGroupNum) {
		Log.debug(SysConfig.class,"setDefaultGroupNum defaultGroupNum = " + defaultGroupNum);
		this.defaultGroupNum = defaultGroupNum;
		
		SharedPreferences.Editor editor = sp.edit();
		editor.putString(Key_DefaultGroupNum, defaultGroupNum);

		editor.commit();
	}
	private void clearDefaultGroup() 
	{
		Log.debug(SysConfig.class,"clearDefaultGroup");
		SharedPreferences.Editor editor = sp.edit();
		editor.putString(Key_DefaultGroupNum,"");

		editor.commit();
	}
	
	public String getSipAuthJson() {
		JSONObject json = new JSONObject();
		try {
			json.put("UserID", tokenUserID);
			json.put("ClientID", getDevId());
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return String.valueOf(json);
	}

	public void setUserID(String userID,String tokenUserID) {
		this.userID = userID;
		this.tokenUserID = tokenUserID;
		if(mcInfo != null)
		{
			mcInfo.setUserId(userID);
		}
		
		SharedPreferences.Editor editor = sp.edit();
		editor.putString(Key_UserId, userID);
		editor.putString(Key_TokenUserID, tokenUserID);

		editor.commit();
	}
	public boolean isAlarm() {
		return isAlarm;
	}

//	public void setAlarm(boolean alarm) {
//		isAlarm = alarm;
//	}
	public void setAlarm(int hasAlarm) {
		if(hasAlarm == 1)
		{
			this.isAlarm = true;
		}
		else
		{
			this.isAlarm = false;
		}

		SharedPreferences.Editor editor = sp.edit();
		editor.putBoolean(Key_IsAlarm, isAlarm);

		editor.commit();
	}

	public boolean isShowApp() {
		return isShowApp;
	}

	public void setShowApp(boolean showApp) {
		isShowApp = showApp;
		SharedPreferences.Editor editor = sp.edit();
		editor.putBoolean(Key_IsShowApp, showApp);

		editor.commit();
	}
	
	public void setGisInterval(int gisInterval) {
		this.gisInterval = gisInterval;
		
		SharedPreferences.Editor editor = sp.edit();
		editor.putInt(Key_GisInterval, gisInterval);

		editor.commit();
	}

	public void setVoiceLevel(float txLevel,float rxLevel) {
		this.txLevel = txLevel;
		this.rxLevel = rxLevel;

		SharedPreferences.Editor editor = sp.edit();
		editor.putFloat(Key_TxLevel, txLevel);
		editor.putFloat(Key_RxLevel, rxLevel);

		editor.commit();
	}
	public float getTxLevel() {
		return txLevel;
	}

	public float getRxLevel() {
		return rxLevel;
	}
	public int getGisInterval() {
		return gisInterval;
	}

	public String getUserID() {
		return userID;
	}

	public String getAllCallGNum() {
		return allCallGNum;
	}

	public GroupInfo getSosGroupInfo() {
		return sosGroupInfo;
	}

	public void setSosGroupInfo(GroupInfo sosGroupInfo) {
		this.sosGroupInfo = sosGroupInfo;
	}

	public void setAllCallGNum(String allCallGNum) {
		Log.debug(SysConfig.class,"setAllCallGNum allCallGNum = " + allCallGNum);
		this.allCallGNum = allCallGNum;
	}

	public String toStrDesc()
	{
		StringBuffer strBuf = new StringBuffer(" SysConfig ");
		strBuf.append("serverInfo = ").append(serverInfo).append(",");
		strBuf.append("mcInfo = ").append(mcInfo).append(".");

		return strBuf.toString();
	}
}
